<?php
require_once "classes/model/TreeNodeBase.php";
class LogicTreeNode extends TreeNodeBase
{
	private $name;
	
	function __construct($name, $siblings = null, $level = null, $id = null)
	{
		parent::__construct("NODOS", $siblings, $level, $id);
		$this->name = $name;
	}
	
	/**
	 * Busca coincidencias de nombre entre un sibling y los de
	 * la lista de siblings del nodo.
	 * @param LogicTreeNode $sibling El sibling a buscar.
	 */
	function containsSibling($sibling)
	{
		foreach($this->siblings as $currentSibling){
			if($currentSibling->getName() == $sibling->getName()){
				return true;
			}
		}
		return false;
	}
	
	function getName()
	{
		return $this->name;
	}
}